export default {
  methods: {
    grounding(id) {
      this.$confirm("是否上架?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async() => {
        const { success, message } = await this.groundingFunc(id)
        if (success) {
          this.$message({ type: "success", message: "上架成功" })
          this.onSearch()
        } else {
          this.$message({ type: "error", message })
        }
      }).catch(() => {

      })
    },
    undercarriage(id) {
      this.$confirm("是否上架?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async() => {
        const { success, message } = await this.undercarriageFunc(id)
        if (success) {
          this.$message({ type: "success", message: "上架成功" })
          this.onSearch()
        } else {
          this.$message({ type: "error", message })
        }
      }).catch(() => {

      })
    }
  }
}
